<!--
    This page contains the form "Walls" on expert mode
    
    ACTUALLY NOT USED
-->

<?php

// Give the header's title and the previous page's link
function CreateWallsExpert($id) {
    echo '
        <table>
            <tr>
                <td class="paddingCell">
                    ' . TXT_ORIENTATION . '
                </td>
                <td>
                    <select id="orientation" name="orientation' . $id . '"  style="width: 150px;">
                        <option selected value="' . TXT_PLEASE_SELECT_AN_OPTION . '">' . TXT_PLEASE_SELECT_AN_OPTION . '</option>
                        <option>' . TXT_NORTH . '</option>
                        <option>' . TXT_EAST . '</option>
                        <option>' . TXT_SOUTH . '</option>
                        <option>' . TXT_WEST . '</option>
                    </select> 
                </td>
            </tr>
            <tr>
                <td class="paddingCell">' . TXT_CONTINUITY . '</td>
                <td>
                    <select id="continuity" name="continuity' . $id . '" style="width: 150px;">
                        <option selected value="' . TXT_PLEASE_SELECT_AN_OPTION . '">' . TXT_PLEASE_SELECT_AN_OPTION . '</option>
                        <option>' . TXT_OUTSIDE_AIR . '</option>
                        <option>' . TXT_UNHEATED_ROOM . '</option> 
                        <option>' . TXT_HEATED_ROOM . '</option>
                        <option>' . TXT_LAND . '</option>
                    </select> 
                </td>
            </tr>
            <tr>
                <td class="paddingCell">' . Couche1 . '</td>
                <td>
                 <select id="material" name="material' . $id . '" style="width: 150px;">
                        <option selected value="' . TXT_PLEASE_SELECT_AN_OPTION . '">' . TXT_PLEASE_SELECT_AN_OPTION . '</option>
                        <option>' . aluminum . '</option>
                        <option>' . cuivre . '</option> 
                        <option>' . sapin . '</option>
                            <option>' . acier . '</option>
                    </select> 
</td>
            </tr>
            <tr>
                <td class="paddingCell">' . Epaisseur . '</td>
                <td><input id="thickness" type="text" name="thickness' . $id . '" /> &nbsp;mètres</td>
            </tr>
        </table>
    ';
}
?>
<script type="text/javascript">
    var orientation = new LiveValidation(<?php echo "'orientation" . TXT_PLEASE_SELECT_AN_OPTION . "'" ?>,  {onlyOnSubmit: true });
    orientation.add(Validate.Exclusion, { within: [ <?php echo "'" . TXT_PLEASE_SELECT_AN_OPTION . "'" ?> ], failureMessage: <?php echo "'" . TXT_FAILURE_CHOOSE_AN_ORIENTATION . "'" ?> } )
        
    var continuity = new LiveValidation('continuity', {onlyOnSubmit: true });
    continuity.add(Validate.Exclusion, { within: [ <?php echo "'" . TXT_PLEASE_SELECT_AN_OPTION . "'" ?> ], failureMessage: <?php echo "'" . TXT_FAILURE_CHOOSE_A_CONTINUITY_TYPE . "'" ?> } )
    
     var continuity = new LiveValidation('material', {onlyOnSubmit: true });
    continuity.add(Validate.Exclusion, { within: [ <?php echo "'" . TXT_PLEASE_SELECT_AN_OPTION . "'" ?> ], failureMessage: <?php echo "'" . TXT_FAILURE_CHOOSE_A_CONTINUITY_TYPE . "'" ?> } )
    }

    var wallHeigth = new LiveValidation('thickness');
    wallHeigth.add( Validate.Presence, { failureMessage: <?php echo "'" . TXT_FAILURE_CANNOT_BE_EMPTY . "'" ?> } );
    wallHeigth.add(Validate.Numericality);
    wallHeigth.add(Validate.Length, { minimum: 1, maximum: 5 } );            
        
</script> 

